package study.rpc.sofa.bolt.support.processor;

import com.alipay.remoting.BizContext;
import com.alipay.remoting.rpc.protocol.SyncUserProcessor;
import lombok.extern.slf4j.Slf4j;
import study.rpc.sofa.bolt.support.io.MyRequest;
import study.rpc.sofa.bolt.support.io.MyResponse;

/**
 *
 */
@Slf4j
public class ServerUserProcessor extends SyncUserProcessor<MyRequest> {

    @Override
    public Object handleRequest(BizContext bizCtx, MyRequest request) throws Exception {
        String name = request.getName();
        log.info("hello, {}", name);

        MyResponse response = new MyResponse();
        response.setMsg("sadfadsfasdf");
        return response;
    }

    @Override
    public String interest() {
        return MyRequest.class.getName();
    }
}
